package com.dk.controller;


import com.dk.pojo.TCity;
import com.dk.service.TCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/*
*  三级联动
* */
@Controller
@RequestMapping("tCityController")
public class TCityController {


    @Autowired
    private TCityService tCityService;

    @RequestMapping("list")
    public String listGet(){
        return "tCity/listGet";
    }

    //根据pid获取城市
    @RequestMapping("getCityByPid")
    @ResponseBody
    public List<TCity> getCityByPid(Integer pid){
        List<TCity> list = tCityService.getCityByPid(pid);
        return list;
    }
}
